I am using TypeScript to generate d.ts files from our existing JavaScript codebase which is annotated using JSDoc, as per https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html.
My problem is that the TS compiler (understandably) cannot handle some non-TS syntax which otherwise is parseable using Babel, specifically export x from 'y', e.g.
export { something } from './somewhere';
This yields the following when emitting types:
app/utils/index.js:76:1 - error TS1128: Declaration or statement expected.
76 export { something } from './somewhere';
I have tried adding the ts-ignore annotation, but it does not seem to work (I am using TS 4.5). I get the same error as above.
// @ts-ignore
export { something } from './somewhere';
Apart from removing this syntax (which is not feasible since we use it a lot), what would be the preferred way of solving this?